package com.example.qxfw.shfx.dto;

import lombok.Data;

import java.util.Objects;

@Data
public class Mylfx {
    private String areaName;
    private double rain;
    private double lon;
    private double lat;

    public Mylfx(final String areaName, final double rain, final double lon, final double lat) {
        this.areaName = areaName;
        this.rain = rain;
        this.lon = lon;
        this.lat = lat;
    }

    public Mylfx() {
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(final String areaName) {
        this.areaName = areaName;
    }

    public double getRain() {
        return rain;
    }

    public void setRain(final double rain) {
        this.rain = rain;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(final double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(final double lat) {
        this.lat = lat;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        final Mylfx mylfx = (Mylfx) o;

        if (Double.compare(mylfx.rain, rain) != 0) return false;
        if (Double.compare(mylfx.lon, lon) != 0) return false;
        if (Double.compare(mylfx.lat, lat) != 0) return false;
        return Objects.equals(areaName, mylfx.areaName);
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = areaName != null ? areaName.hashCode() : 0;
        temp = Double.doubleToLongBits(rain);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(lon);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(lat);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }


}
